<template>
    <view class="user" style="background-image: url('../../static/images/my.png');">
       <view v-for="(item, index) in state.pages" :key="index">
            <template v-if="item.name == 'user-info'">
			<!-- <template> -->
                <w-user-info
                    :content="item.content"
                    :styles="item.styles"
                    :user="userInfo"
                    :is-login="isLogin"
                />
            </template>
            <!-- <template v-if="item.name == 'my-service'">
                <w-my-service :content="item.content" :styles="item.styles" />
            </template>
            <template v-if="item.name == 'user-banner'">
                <w-user-banner :content="item.content" :styles="item.styles" />
            </template> -->
        </view>
        <!-- <tabbar /> -->
		<!-- <view class="users"> -->
		<!-- 	<image class="users-photo" src="../../static/images/IMG_4870@3x.png" mode=""></image>
			请登录 -->
			<!-- <view class="user-info flex px-[50rpx] justify-between py-[50rpx]">
			    <view
			        v-if="isLogin"
			        class="flex items-center"
			        @click="navigateTo('/pages/user_data/user_data')"
			    >
			        <u-avatar :src="user.avatar" :size="120"></u-avatar>
			        <view class="text-white ml-[20rpx]">
			            <view class="text-2xl">{{ user.nickname }}</view>
			            <view class="text-xs mt-[18rpx]" @click.stop="copy(user.account)">
			                账号：{{ user.account }}
			            </view>
			        </view>
			    </view>
			    <navigator v-else class="flex items-center" hover-class="none" url="/pages/login/login">
			        <u-avatar src="../../static/images/IMG_4870@3x.png" :size="120"></u-avatar>
			        <view >请登录</view>
			    </navigator>
			    <navigator v-if="isLogin" hover-class="none" url="/pages/user_set/user_set">
			        <u-icon name="setting" color="#fff" :size="48"></u-icon>
			    </navigator>
			</view> -->
		<!-- </view> -->
    </view>
	<custom-tabbar :curr-page="4" />
</template>

<script setup lang="ts">
import { getDecorate } from '@/api/shop'
// import { getPdf } from '@/api/user'
import { useUserStore } from '@/stores/user'
import { onShow } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { reactive } from 'vue'
	import customTabbar from "@/components/custom-tabbar.vue"

const state = reactive<{
    pages: any[]
}>({
    pages: []
})
const getData = async () => {
    const data = await getDecorate({ id: 2 })
    state.pages = JSON.parse(data.data)
}
const userStore = useUserStore()
const { userInfo, isLogin } = storeToRefs(userStore)
onShow(() => {
    userStore.getUser()
	console.log(userInfo.value,'userInfo11111111111111');
})
getData()

// const pdfFn=async()=>{
// 		  try {
// 		    const data = await getPdf();
// 		    // paging.value.complete(data.lists);
// 		  } catch (error) {
// 		    // paging.value.complete(false);
// 		  }
		

// }
</script>

<style scoped>
	.user{
		width: 100%;
		height: 155vh;
		/* height: auto; */
		/* background-size: contain; */
		background-size: 100% 100%;
		position: relative;
	}
	.users{
		position: absolute;
		top: 184rpx;
		left: 36rpx;

		font-size: 40rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #252525;
		
	}
	.users-photo{
		width: 120rpx;
		height: 120rpx;
		vertical-align: middle;
	}
</style>
